Fix the array size of mpidr_aff_map_nodes_t.
authorSoby Mathew <[email protected]>
Thu, 4 Dec 2014 14:14:12 +0000 (14:14 +0000)
committerSoby Mathew <[email protected]>
Thu, 4 Dec 2014 16:09:00 +0000 (16:09 +0000)
This patch fixes the array size of mpidr_aff_map_nodes_t which
was less by one element.

Fixes ARM-software/tf-issues#264

Change-Id: I48264f6f9e7046a3d0f4cbcd63b9ba49657e8818

include/lib/aarch64/arch.h
services/std_svc/psci/psci_private.h

index 476c9c5c0d235c98402ec3121c584ecd88924c20..52916846c2c9868d6e5093da9335edac52ba867b 100644 (file)
 #define MPIDR_AFFLVL1          1
 #define MPIDR_AFFLVL2          2
 #define MPIDR_AFFLVL3          3
-/* TODO: Support only the first 3 affinity levels for now */
+/*
+ * The MPIDR_MAX_AFFLVL count starts from 0. Take care to
+ * add one while using this macro to define array sizes.
+ * TODO: Support only the first 3 affinity levels for now.
+ */
 #define MPIDR_MAX_AFFLVL       2
 
 /* Constant to highlight the assumption that MPIDR allocation starts from 0 */
index 924a24f5f32528bfb331064ed79a3e1ac4b91f4b..24a5604e7dcf4aff3e45e9f729fd6158f56a28d0 100644 (file)
@@ -60,7 +60,7 @@ typedef struct aff_limits_node {
        int max;
 } aff_limits_node_t;
 
-typedef aff_map_node_t (*mpidr_aff_map_nodes_t[MPIDR_MAX_AFFLVL]);
+typedef aff_map_node_t (*mpidr_aff_map_nodes_t[MPIDR_MAX_AFFLVL + 1]);
 typedef unsigned int (*afflvl_power_on_finisher_t)(aff_map_node_t *);
 
 /*******************************************************************************